Non transactional cache hit/miss statistics#308
Non transactional cache hit/miss statistics#308ddorian wants to merge 1 commit intograntjenks:masterfrom
Conversation
I don’t see why these changes are necessary for this use cases. I think you could track hits/misses outside the cache already and update a different key (or cache) with the information asynchronously. Leveraging the cache’s Settings metadata seems like a mistake. |
The first use case is even the default implementation to not be transactional (less locking when having statistics and reading from external files). The other idea is I'd have to add another approach (can't reuse self.statistics, have to check the returned value in get() and compare it against default, etc). |
@grantjenks
This is to move cache hit/miss outside of the get transaction.
A use case is to override it, make it async, and update the hit/miss counters in the db every 2-seconds instead of every transaction.
If you agree I'll fix linting etc.